<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>信息后台管理系统</title>
<link rel="shortcut icon" href="${request.contextPath}/bootstrap/img/loading.gif" >
<link rel="stylesheet" type="text/css" href="${request.contextPath}/res/jquery-easyui-1.3.6/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/res/jquery-easyui-1.3.6/themes/icon.css">
<script type="text/javascript" src="${request.contextPath}/res/jquery-easyui-1.3.6/jquery-1.11.1.js"></script>
<script type="text/javascript" src="${request.contextPath}/res/jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/res/jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js"></script>
<style>
</style>

<script>
function updatePassword(){
	$("#dd").dialog("open");
}

function updatePasswordSubmit(){
	var oldPassword = $("#oldPassword").val();
	var newPassword = $("#newPassword").val();
	var newPassword2 = $("#newPassword2").val();
	if("" == oldPassword || ""==newPassword || ""==newPassword2){
		alert("新旧密码不能为空");
		return;
	}
	if(newPassword != newPassword2){
		alert("两次新密码不一致");
		return;
	}
	$.ajax({
		type:"post",
		url:"update/password",
		async:true,
		data:{"oldPassword":oldPassword, "newPassword":newPassword},
		success:function(result){
			alert(result.msg);
			if(result.status == 1){
				window.location.reload();
			}
			dialogCloseWindow();
		}
	});
}

function dialogCloseWindow(){
	$("#dd").dialog("close");
}

</script>
</head>
<body id="body" class="easyui-layout" style="width: 100%; height: 100%;">
	<!-- 头部 -->
	<div data-options="region:'north',border:false" style="border: 0px red solid; height: 60px; overflow: hidden;">
		<div id="logo">
			<h1 style="float:left; height: 25px;">
			欢迎您,<span style="color: red;">${sysAdmin.nickname}[${sysAdmin.fullname}]</span>
			</h1>
			<div style="width: 400px; float: right; height: 25px; margin-top: 30px;">
				<div id="mb2" style="float: right; width: 100px; margin-right: 5px; background-color: #E0ECFF;">
					<a href="javascript:void(0)" class="easyui-menubutton"    
        			data-options="menu:'#mm2',iconCls:'icon-edit'" style="width: 100px; height: 25px;">控制面板</a>  
					<div id="mm2" style="width:150px;">  
					    <div data-options="iconCls:'icon-undo'" onclick="updatePassword()">修改密码</div> 
					    <div>
					    	<a href="${request.contextPath}/mgr/loginout">安全退出</a> 
					    </div>
					</div> 
				</div>
			</div>
		</div>
	</div>
	
	
	<div id="dd" class="easyui-dialog" title="修改密码" style="width:300px;height:150px; padding: 5px;"  
	        data-options="iconCls:'icon-save',closed:true,closable:false,
	        resizable:true,modal:true,
	        buttons:[{
				text:'确定',
				handler:updatePasswordSubmit
			},{
				text:'关闭',
				handler:dialogCloseWindow
			}]"> 
		    <table border="0" cellspacing="0" cellpadding="0" style="margin:auto">
		    	<tr>
		    		<td style="text-align: right;">旧密码:</td>
		    		<td><input type="password" name="oldPassword" id="oldPassword" value="" /></td>
		    	</tr>
		    	<tr>
		    		<td style="text-align: right;">新密码:</td>
		    		<td><input type="password" name="newPassword" id="newPassword" value="" /></td>
		    	</tr>
		    	<tr>
		    		<td style="text-align: right;">确认信密码:</td>
		    		<td><input type="password" name="newPassword2" id="newPassword2" value="" /></td>
		    	</tr>
		    </table>   
		</div>  
	
	<!-- 头部  end -->
	
	<!--描述：菜单内容区域-->
	<div data-options="region:'west',title:'系统菜单',split:true" style="width:150px; overflow: hidden;">
		<div id="aa" class="easyui-accordion" style="width:150px;" data-options="fit:true"> 
			<#if sysAdmin.nickname == "admin">
				  <div title="系统管理" data-options="iconCls:'icon-save'" style="padding:10px;">
			    	<h4 style="text-align: center;"><a href="members" target="mainWindow">会员管理</a></h4>
			    </div>  
			</#if>
		    <div title="信息管理" data-options="iconCls:'icon-reload', selected:true" style="padding:10px;">  
		        <h4 style="text-align: center;"><a href="users" target="mainWindow">注册客户管理</a></h4>
		    	<h4 style="text-align: center;"><a href="code" target="mainWindow">推荐码管理</a></h4>   
		    </div>  
		</div>  
	</div>
	<!--描述：菜单内容区域  结束-->
	
	
	<!--描述：主要内容区域-->
	<div data-options="region:'center'" style="width: 100%; height: 100%;">
		<iframe name="mainWindow" style="width: 100%; height: 100%;" src="users">
		</iframe>
	</div>
	
	<!-- 底部信息  -->
	<div data-options="region:'south',border:false" style="height:30px;background:#A9FACD;">
		<div style="text-align: center; height: 30px; line-height: 30px;">
			版权所有<span><a href="http://www.nxyhgjs.com" target="_bank">宁夏银汇</a></span>
		</div>
	</div> 
</body>
</html>